[New Rule] AWS CloudWatch Log Retention Policy Set to Short Duration#5835
[New Rule] AWS CloudWatch Log Retention Policy Set to Short Duration#5835
Conversation
This PR adds a new detection rule for AWS CloudWatch Log Group retention policy tampering, addressing a coverage gap for the **T1562.008 - Impair Defenses: Disable or Modify Cloud Logs** technique as documented in the [AWS Threat Technique Catalog](https://aws-samples.github.io/threat-technique-catalog-for-aws/Techniques/T1562.008.html). Adversaries may use the `PutRetentionPolicy` API to set suspiciously short retention periods on CloudWatch Log Groups, causing logs to be automatically purged before incident response teams can analyze them. Unlike `DeleteLogGroup` or `DeleteLogStream`, this technique is subtler and may go unnoticed. ### False Positive Considerations During testing, I observed significant false positive potential from **Assumed roles in development environments** - Software development workflows frequently use short retention periods (often 1 day) for ephemeral log groups created during CI/CD pipelines, testing, or local development. Rule severity will remain low for this reason and I've left recommendations for tuning.
Rule: New - GuidelinesThese guidelines serve as a reminder set of considerations when proposing a new rule. Documentation and Context
Rule Metadata Checks
New BBR Rules
Testing and Validation
|
Mikaayenson
left a comment
There was a problem hiding this comment.
This one seems heavy on the compliance side. Can we update this to be more threat focused? Looking at the link https://aws-samples.github.io/threat-technique-catalog-for-aws/Techniques/T1562.008.html it seems like there's something potentially better we can detect. WDYT?
@Mikaayenson We already had pretty good coverage for this technique actually, covered 5 out of 7 of the listed APIs. This was meant to fill the gaps for one of the API calls we don't cover. I'm working on a tuning to address this technique as well which will add the |

Pull Request
Issue link(s):
Summary - What I changed
This PR adds a new detection rule for AWS CloudWatch Log Group retention policy tampering, addressing a coverage gap for the T1562.008 - Impair Defenses: Disable or Modify Cloud Logs technique as documented in the AWS Threat Technique Catalog.
Adversaries may use the
PutRetentionPolicyAPI to set suspiciously short retention periods on CloudWatch Log Groups, causing logs to be automatically purged before incident response teams can analyze them. UnlikeDeleteLogGrouporDeleteLogStream, this technique is subtler and may go unnoticed.False Positive Considerations
During testing, I observed significant false positive potential from Assumed roles in development environments - Software development workflows frequently use short retention periods (often 1 day) for ephemeral log groups created during CI/CD pipelines, testing, or local development.
Rule severity will remain low for this reason and I've left recommendations for tuning.
How To Test
Screenshot of working query